cmake_minimum_required(VERSION 3.10)

project(pikachu)

# 设置FindSDL2的搜索路径
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")

# 找到SDL2 如果未找到，则失败
find_package(SDL2 REQUIRED)


#添加
include_directories(${SDL2_INCLUDE_DIR})


add_executable(pikachu WIN32 main.cpp)

# SDL2::SDL2main may or may not be available. It is e.g. required by Windows GUI applications
if(TARGET SDL2::SDL2main)
    # It has an implicit dependency on SDL2 functions, so it MUST be added before SDL2::SDL2 (or SDL2::SDL2-static)
    target_link_libraries(pikachu PRIVATE SDL2::SDL2main)
endif()

# Link to the actual SDL2 library. SDL2::SDL2 is the shared SDL library, SDL2::SDL2-static is the static SDL library
# target_link_libraries(pikachu PRIVATE SDL2::SDL2)

target_link_libraries(pikachu 
                        ${SDL2_LIBRARY})

# set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR})
